import pymysql

# 1. 连接MySQL
conn=pymysql.connect(host="127.0.0.1",port=3306,user="root",password="yafeilu",charset="utf8",db="unicom")
cursor=conn.cursor(cursor=pymysql.cursors.DictCursor)

# 2.发送指令
sql = "update admin set mobile=%s where username=%s"
cursor.execute(sql,["15888886668","刘朝朋"])
conn.commit()

# 3.关闭连接
cursor.close()
conn.close()